export const rules = {
    weixin: {
        // pattern: /^[a-zA-Z]{1}[-_a-zA-Z0-9]{5,19}$/,
        pattern: /^[^\u4e00-\u9fa5][-_a-zA-Z0-9]{5,19}$/,
        message: '请输入合法微信号'
    },
    phone: {
        pattern: /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/,
        message: '请输入合法手机号'
    },
    qq: {
        pattern: /^[1-9][0-9]{4,10}$/,
        message: '请输入合法qq'
    },
    age: {
        pattern: /^(?:[1-9][0-9]?|1[01][0-9]|120)$/,
        message: '请输入合法年龄'
    },
    password: {
        pattern: /^[a-zA-Z0-9]{8,20}$/,
        message: '密码至少包含字母，数字，且不少于8位'
    }

}
/*将对象转换为路由参数*/
export function dataToUri(data) { //将对象转换为路由参数
    let uri = ''
    Object.keys(data).forEach(function(key){
       uri += key+'='+data[key]+"&"
    });
}
